import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;

import java.io.File;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;

/**
 * @author kongwg
 * @create 2021-01-20 20:04
 */
public class JsoupTest {
    public static void main(String[] args) throws Exception {
        String url = "https://search.jd.com/Search?keyword=java";
        Document document = Jsoup.parse(new URL(url),3000);
        String html = document.html();
//        System.out.println(html);

        String is = ClassLoader.getSystemClassLoader().getResource("student.xml").getPath();

        Document is1 = Jsoup.parse(new File(is),"utf-8");
        Elements name = is1.getElementsByTag("name");
        System.out.println(name.text());

    }
}
